<template>
  <div class="execution">
    <avue-form
      ref="form"
      v-model="obj"
      :option="option"
      @submit="submit"
    >
      <template slot="menuForm">
        <el-button icon="el-icon-user" type="primary" @click="submit">提 交</el-button>
      </template>
    </avue-form>
  </div>
</template>

<script>
import { fetchData, put } from "@/api/admin/set";
import { mapGetters } from "vuex";
import moment from "moment";

export default {
  data() {
    return {
      obj: {}
    };
  },
  computed: {
    option() {
      return {
        submitText: "完成",
        labelWidth: '200',
        emptyBtn:false,
        submitBtn:false,
        column: [
          {
            label: "每日对接次数",
            prop: "num",
            span: 8,
            row: true
          },
          {
            label: "客服微信",
            prop: "wx",
            span: 8,
            row: true
          },
          {
            label: "列表页过滤按钮（可对接）",
            prop: "is_contact",
            span: 12,
            type: "switch",
            dicData: [{
              label: '不显示',
              value: 0
            },{
              label: '显示',
              value: 1
            }],
            hide: true,
            row: true
          },
          {
            label: "列表页过滤按钮（VIP）",
            prop: "is_vip",
            span: 12,
            type: "switch",
            dicData: [{
              label: '不显示',
              value: 0
            },{
              label: '显示',
              value: 1
            }],
            hide: true,
            row: true
          },
          {
            label: "vip6个月价格",
            prop: "vip6",
            span: 8,
            row: true
          },
          {
            label: "vip12个月价格",
            prop: "vip12",
            span: 8,
            row: true
          },
          {
            label: "svip6个月价格",
            prop: "svip6",
            span: 8,
            row: true
          },
          {
            label: "svip12个月价格",
            prop: "svip12",
            span: 8,
            row: true
          },
        ]
      };
    }
  },
  created() {},
  mounted: function() {
    this.getList()
  },
  methods: {
    getList(page, params) {
      this.tableLoading = true;
      fetchData().then(response => {
        this.obj = response.data.data
        this.tableLoading = false;
      });
    },
    submit () {
      put(this.obj).then(response => {
        this.$notify.success("修改成功");
        this.getList()
      });
    },
  }
};
</script>
<style lang="less" scoped>
  .execution {
    margin-top: 30px;
  }
</style>
